require(['Jquery','Hui','HuiAdmin','Layer'], function(jquery,hui,huiadmin,layer){

	/**
	 * AJAX方式表单提交()
	 */
	function ajaxSubmitFrom(){
		$('.submit').click(function () {
			var self = $(this),
			form = self.parents("form");//找到祖先元素里面的form元素

			url        = form.attr('action');
			formData   = form.serialize();

		    $.post(url,formData,function(json) {
	      		if (json.code) {
	      			layer.alert(json.msg,{icon: 1});
	      			pageReload(1500);
	      		} else {
	      			layer.alert(json.msg,{icon: 5});//图标5是为了区分js的报错
	      		}

	      	},"json");
		});
	}

	// 选项卡效果
	$.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","mousemove","0");

	// ajax方式提交表单
	ajaxSubmitFrom();
});